﻿using Common.Data.Repository.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Data.Repository
{
    public class DataParameter
    {
        public DataParameter()
        {
            this.Direction = DataDirection.Input;
            this.Value = null;
            this.Name = string.Empty;
        }

        public DataParameter(string name, object value)
        {
            this.Direction = DataDirection.Input;
            this.Value = value;
            this.Name = name;
        }

        public DataParameter(string name, DataType type)
        {
            this.Direction = DataDirection.Input;
            this.Value = null;
            this.Name = name;
            this.Type = type;
            if (this.Type == DataType.Cursor) this.Direction = DataDirection.Output;
        }

        public DataParameter(string name, object value, DataType type)
        {
            this.Type = type;
            this.Value = value;
            this.Name = name;
        }

        public DataParameter(string name, object value, DataType type, DataDirection direction)
        {
            this.Direction = direction;
            this.Type = type;
            this.Value = value;
            this.Name = name;
        }

        public string Name { get; set; }
        public object Value{ get; set; }
        public DataDirection Direction { get; set; }
        public DataType Type { get; set; }
    }
}
